//: reusing/Cartoon.java
// Constructor calls during inheritance.
package reusing;
import static net.mindview.util.Print.*;
//子类实例化，先调用父类构造
class Art {
 private  Art() { print("Art constructor"); }

  Art(int a){
    System.out.println(a);
  }
}

class Drawing extends Art {
  Drawing() {
//    makeArt();
    super(4);
    print("Drawing constructor"); }
}

public class Cartoon extends Drawing {
  public Cartoon() { print("Cartoon constructor"); }
  public static void main(String[] args) {
    Cartoon x = new Cartoon();
  }
} /* Output:
Art constructor
Drawing constructor
Cartoon constructor
*///:~
